<template>
	<view class="container" :class="{ stepBottom: step==0 }">
		<navbar :config="config" backColor="#000" @onlyLink='onlyLink'></navbar>
		<form @submit="nextStep">
			<!--企业信息-->
			<view v-if="step==0">
				<view class="stepOne">
					<!-- <view>
            <text class="iconfont font68">&#xe696;</text>
          </view> -->

					<view class="stepOneTitle">
						<view class="stepOneTitleLeft">
							<image :src="imgUrl+'/registerAndAudit/one.png'"></image>
							<view>企业信息</view>
						</view>
						<view class="stepOneTitleLine"></view>
						<view class="stepOneTitleRight">
							<image :src="imgUrl+'/registerAndAudit/huiTwo.png'"></image>
							<view>店铺信息</view>
						</view>
					</view>
				</view>
				<view class="huiView">

				</view>
				<view>
					<view class="longView" style="margin-top: 0;">
						<view class="barView">
							<!-- <text class="vertical-bar">|</text> -->
							<image :src="imgUrl+'/uploading/redLine.png'" class="vertical-bar"></image>
							<text class="titleView">企业信息</text>
						</view>
						<view>
							<view class="uni-form-item  uni-form-item-left ">
								<required-tag></required-tag>
								<input class="uni-input " maxlength="16" name="company_name"
									 v-model="dataform.company_name"
									placeholder-style="text-align:left" style="text-align:left"
									placeholder="请输入企业名称(必填)" />
							</view>
							<view class="uni-form-item uni-form-item-left marginLeft33">
								<input class="uni-input " maxlength='18' name="credit_code"
									v-model="dataform.credit_code" placeholder-style="text-align:left"
									style="text-align:left" placeholder="请输入统一信用代码" />
							</view>
							<view class="uni-form-item uni-form-item-left marginLeft33">
								<input class="uni-input " maxlength='25' placeholder-style="text-align:left"
									style="text-align:left" name="business_scope" v-model="dataform.business_scope"
									placeholder="请输入经营范围" />
							</view>
							<!-- <picker class="pickerList" mode="multiSelector" :range="newProvinceDataList"
								range-key="label" :value="multiIndex" @change="enterprisePickerChange"
								@columnchange="enterprisePickerColumnchange">
								<view class="uni-form-item u-flex ">
									<view class="title u-font28 u-474747">所属地区</view>
									<view v-if="dataform.province != '' " class="uni-input u-font26">
										{{dataform.province}}
									</view>
									<view v-if="dataform.province == '' " class="uni-input u-999">请选择省市区</view>
								</view>
							</picker> -->
							<view class="uni-form-item uni-form-item-left" style="width: 100%;position: relative"
								@click="openAreaSelect(1)">
								<required-tag></required-tag>
								<view v-if="dataform.province != '' " class="uni-input pleaseCity">
									{{dataform.province}}
								</view>
								<view v-if="dataform.province == '' " class="uni-input pleaseCity"
									style="color:#999999">
									请选择省市区(必填)</view>
								<image :src="imgUrl+'/personal/huiRight.png'" class="huiRight"></image>
							</view>


							<view class="uni-form-item uni-form-item-left marginLeft33">
								<input maxlength='25' placeholder-style="text-align:left" style="text-align:left"
									name="company_address" v-model="dataform.company_address" placeholder="请输入详细地址" />
							</view>
						</view>
					</view>
				</view>
				<!--法人信息-->
				<!-- class="u-mt20" bg-fff -->
				<view>
					<view class="longView" style="margin-top:0">
						<view class="barView">
							<image :src="imgUrl+'/uploading/redLine.png'" class="vertical-bar"></image>
							<text class="titleView">法人信息</text>
						</view>
						<view>
							<view class="uni-form-item uni-form-item-left">
								<required-tag></required-tag>

								<input class="uni-input " maxlength='5' name="legal_representative"
									 v-model="dataform.legal_representative"
									placeholder-style="text-align:left" style="text-align:left"
									placeholder="请输入法人姓名(必填)" />

							</view>
							<view class="uni-form-item marginLeft33 flex-spaceBetween">
								<view class="labelView ">请选择证件类型</view>
								<view class="radioView">
									<label class="radio" @click="radio(0)">
										<radio value="0" style="transform:scale(0.7)" :checked="dataform.id_type==0"
											activeBackgroundColor="#FF211F" color="#FF211F" />
										<view class="radioLabel" :class="{ dataformView: dataform.id_type==0 }">身份证
										</view>
									</label>
									<label class="radio u-ml20" @click="radio(1)">
										<radio value="1" style="transform:scale(0.7);" :checked="dataform.id_type==1"
											activeBackgroundColor="#FF211F" color="#FF211F" />
										<view class="radioLabel" :class="{ dataformView: dataform.id_type==1}">护照</view>
									</label>
								</view>
							</view>
							<view class="uni-form-item marginLeft33">
								<input class="uni-input " maxlength="18" name="id_number"
									placeholder-style="text-align:left" style="text-align:left"
									v-model="dataform.id_number" placeholder="请输入证件号码" />
							</view>
							<view class="uni-form-item uni-form-item-left">
								<required-tag></required-tag>
								<view>
									<input class="uni-input" type="number" name="lr_mobile" maxlength="11"
										v-model="dataform.lr_mobile"
										placeholder-style="text-align:left" style="text-align:left"
										placeholder="请输入法人手机号(必填)" />
								</view>

							</view>
							<view class="uni-form-item uni-form-item-left">
								<required-tag></required-tag>
								<input class="uni-input" maxlength='20' name="lr_email"
									laceholder-style="text-align:left" v-model="dataform.lr_email"
									style="text-align:left"  placeholder="请输入法人邮箱(必填)" />

							</view>
						</view>
					</view>
				</view>

				<!--上传图片-->
				<!-- class="bg-fff u-mt10" -->
				<view>
					<view class="longView" style="margin-top: 0;">
						<view class="barView">
							<text class="vertical-bar">|</text>
							<text class="titleView">上传附件</text>
						</view>
						<view class="">

							<view class="">
								<uploadImg imgCount="2" uploadImgCount="2" :imgArr="business_license_images"
									:type="upimgtype" title="请上传营业执照" url="" @result="resultUrlthree"></uploadImg>
							</view>
						</view>
						<view class="">

							<view class="">
								<uploadImg imgCount="2" title="请上传法人申请身份证" uploadImgCount="2" :imgArr="identty_images"
									:type="upimgtype" url="" @result="resultUrlone"></uploadImg>
							</view>
						</view>
					</view>
				</view>
				<view class="btn" v-if="dataform.audit_status !=0">
					<button class="u-btnAudit" :disabled="!(dataform.company_name&&dataform.province&&
					dataform.legal_representative&&dataform.lr_mobile&&dataform.lr_email)" v-if="step==0"
						form-type="submit">下一步</button>
				</view>
			</view>
		</form>
		<form @submit="formSubmit">
			<!-- v-if="step==1" -->
			<view v-if="step==1">
				<view class="stepOne">

					<view class="stepOneTitle">
						<view class="stepOneTitleLeft">
							<image :src="imgUrl+'/registerAndAudit/nike.png'"></image>
							<view>企业信息</view>
						</view>
						<view class="stepOneTitleLine"></view>
						<view class="stepOneTitleRight">
							<image :src="imgUrl+'/registerAndAudit/redTwo.png'"></image>
							<view>店铺信息</view>
						</view>
					</view>
				</view>
				<view class="huiView">
				</view>
				<view class="longView" style="margin-top: 0;">
					<view class="barView">
						<image :src="imgUrl+'/uploading/redLine.png'" class="vertical-bar"></image>
						<text class="titleView">企业信息 <text class="titleViewText">(审核失败后可修改)</text></text>
					</view>
					<view>
						<view class="uni-form-item uni-form-item-left">
							<required-tag></required-tag>
							<input class="uni-input " maxlength='16' placeholder-style="text-align:left"
								style="text-align:left" name="shop_name" v-model="dataform.shop_name"
								 placeholder="请输入店铺名称" />
						</view>
						<!-- <picker class="pickerList" mode="multiSelector" :range="newProvinceDataList"
								range-key="label" :value="multiIndex" @change="pickerChange"
								@columnchange="pickerColumnchange">
								<view class="uni-form-item u-flex ">
									<view class="title u-font28 u-1A1A1A">所属地区</view>
									<view class="uni-input u-font26" v-if="dataform.province_name != '' ">
										{{dataform.province_name}}{{dataform.city_name}}{{dataform.area_name}}
									</view>
									<view v-if="dataform.province_name == '' " class="uni-input u-999">请选择省市区</view>
								</view>
							</picker> -->
						<view class="uni-form-item uni-form-item-left" style="width: 100%;position: relative"
							@click="openAreaSelect(2)">
							<required-tag></required-tag>
							<view class="uni-input pleaseCity" style="text-align: left;"
								v-if="dataform.province_name != '' ">
								{{dataform.province_name}}{{dataform.city_name}}{{dataform.area_name}}
							</view>
							<view v-if="dataform.province_name == '' " class="uni-input pleaseCity"
								style="color:#999999">请选择省市区</view>
							<image :src="imgUrl+'/personal/huiRight.png'" class="huiRight"></image>

						</view>
						<!-- <view class="uni-form-item u-flex " @click="streetChange">
								<view class="title u-font28 u-1A1A1A">所属街道</view>
								<view v-if="dataform.street_name " class="uni-input u-font26">{{dataform.street_name}}
								</view>
								<view v-else class="uni-input u-999">请选择街道</view>
							</view>
							<view class="uni-form-item u-flex " @click="communityChange">
								<view class="title u-font28 u-1A1A1A">所属社区</view>
								<view v-if="dataform.community_code" class="uni-input u-font26">
									{{dataform.community_name}}
								</view>
								<view v-else class="uni-input u-999">请选择社区</view>
							</view> -->
						<view class="uni-form-item marginLeft33 flex-spaceBetween">
							<input class="uni-input " maxlength='20' placeholder-style="text-align:left"
								style="text-align:left" name="address" 
								v-model="dataform.address" type="button" placeholder="详细地址" />
						</view>
						<view class="uni-form-item marginLeft33 flex-spaceBetween" @click="goMap">
							<view class="labelView ">店铺地图选址</view>
							<!-- <view class="iconfont" v-if="showSelected==false">&#xe6db;</view> -->
							<view class="radioLabel" v-if="showSelected==true">已选</view>
						</view>

						<view class="uni-form-item uni-form-item-left">
							<required-tag></required-tag>

							<input class="uni-input " v-model="dataform.customer_service_phone"
								placeholder-style="text-align:left" style="text-align:left" maxlength="11"
								name="customer_service_phone" 
								placeholder="请输入客服电话" />
						</view>
						<view class="uni-form-item marginLeft33 flex-spaceBetween">
							<view class="labelView" style="width: 300rpx;">请选择营业时间</view>
							<input class="uni-input " maxlength="26" name="business_hours" disabled @click="goWeeks()"
								v-model="dataform.business_hours"
								style="font-weight: 400;font-size: 27rpx;color: #999999;line-height: 27rpx;"
								placeholder="00:00" />
						</view>
						<view class="uni-form-item marginLeft33 yingyeTime">
							<view class="labelView">营业时间段</view>
							<view class="timeView">
								<picker mode="time"  @change="beginTimeChange">
									<input class="uni-input " name="beginTime" disabled v-model="beginTime"
										placeholder="开始时间"
										style="width: 180rpx;font-weight: 400;font-size: 27rpx;color: #999999;line-height: 27rpx;" />
								</picker>
								<picker mode="time" v-model="endTime" @change="endTimeChange" class="u-ml20">
									<input class="uni-input " name="endTime" disabled 
										placeholder="结束时间"
										style="width: 180rpx;font-weight: 400;font-size: 27rpx;color: #999999;line-height: 27rpx;" />
								</picker>
							</view>
						</view>

						<view class="uni-form-item marginLeft33 flex-spaceBetween">
							<input class="uni-input " maxlength='20' placeholder-style="text-align:left"
								style="text-align:left" name="main_name" v-model="dataform.main_name"
								placeholder="请输入商业主体名称" />
						</view>
						<view class="uni-form-item marginLeft33 flex-spaceBetween">
							<input class="uni-input " maxlength='5' placeholder-style="text-align:left"
								style="text-align:left" name="loser" v-model="dataform.loser" placeholder="请输入运营人姓名" />
						</view>
						<view class="uni-form-item marginLeft33 flex-spaceBetween">
							<input class="uni-input " placeholder-style="text-align:left" style="text-align:left"
								type="number" maxlength='11' name="mobile" v-model="dataform.mobile"
								placeholder="请输入运营人手机号" />
						</view>

						<template v-if="settleMode == 1">
							<view class="uni-form-item marginLeft33 flex-spaceBetween">
								<input class="uni-input" max="100" placeholder-style="text-align:left"
									style="text-align:left" name="reward_ratio"
									v-model="dataform.reward_ratio" placeholder="请输入门店打赏比例(%)" />
							</view>

							<view class="uni-form-textarea">
								<textarea class="textarea" maxlength='400' name="special_offers"
									v-model="dataform.special_offers" placeholder="请输入优惠介绍"
									placeholder-class="textareaPlace"></textarea>
							</view>
						</template>
						<view class="uni-form-textarea">
							<textarea class="textarea" maxlength='400' placeholder-class="textareaPlace" name="remark"
								v-model="dataform.remark" placeholder="请输入店铺介绍"></textarea>
						</view>
						<view class="uni-form-textarea">
							<textarea class="textarea" maxlength='200' placeholder-class="textareaPlace"
								name="place_remark" v-model="dataform.place_remark" placeholder="请输入场地说明"></textarea>
						</view>
					</view>

				</view>

				<!--上传图片-->
				<view >
					<view class="u-plr30">
						<view class="barView">
							<text class="vertical-bar">|</text>
							<text class="titleView">申请材料</text>
						</view>
						<view>
							<!-- <required-tag></required-tag> -->
							<view>
								<uploadImg imgCount="1" :imgArr="logo" :type="upimgtype" url="" title="请上传店铺logo"
									tag="true" @result="resultUrlLogo">
								</uploadImg>
							</view>
						</view>
						<view>
							<view>
								<uploadImg imgCount="2" title="请上传店铺图片" :imgArr="store_images" :type="upimgtype" url=""
									@result="resultUrltwo" uploadImgCount="2"></uploadImg>
							</view>
						</view>
						<view class="u-flex-center gouxuanView">
							<view class="check" @click="aggrementCheck">
								<text class="iconfont iconbox u-font32" style="color: #FF211F;"
									v-if="checkAggrement">&#xe646;</text>
								<view class="radios" v-else></view>
							</view>
							<text class="gouxuan" @click="linkAgreement">勾选注册协议及隐私声明</text>
						</view>

						<view  v-if="dataform.audit_status !=0" style="margin-top: 77rpx;">
							<button class="weeks-btn" form-type="submit" v-if="step==1">立即提交</button>
						</view>
					</view>
				</view>
			</view>
		</form>

		<u-popup mode="bottom" v-model="weekShow" ref="weeksOpen">
			<view class="u-bg-fff u-p30">
				<view class="week" :class="{ checkedYes: checkedArrey.indexOf(item) != -1 }"
					v-for="(item,index) in weeks" :key="index" @click="appointment(item)">
					<view>{{item}}</view>
				</view>
				<view>
					<button class="weeks-btn" @click="gbClose()">确定</button>
				</view>
			</view>
		</u-popup>
		<!-- 地区 -->
		<u-select v-model="areaShow" mode="mutil-column-auto" :list="newProvinceDataList" @confirm="areaConfirm"
			confirmColor="#FF211F" cancelColor="#474747">
		</u-select>
		<!-- 街道弹窗 -->
		<u-select v-model="streetShow" mode="single-column" :list="streetList" @confirm="streetConfirm"
			confirmColor="#FF211F" cancelColor="#474747"></u-select>
		<!-- 社区弹窗 -->
		<u-select v-model="communityShow" mode="single-column" :list="communityList" @confirm="communityConfirm"
			confirmColor="#FF211F" cancelColor="#474747">
		</u-select>
	</view>
</template>

<script>
	import uploadImg from "../../../components/uploadImg/imgUpload.vue"
	import uniPopup from "../../../components/uni-popup/uni-popup.vue"
	import {
		cos
	} from "mathjs"
	export default {
		components: {
			uploadImg,
			uniPopup
		},
		data() {
			return {
				imgUrl: this.$mConfig.staticUrl,
				config: {
					back: true, //false是tolbar页面 是则不写
					title: '线上商家入驻',
					color: '#000',
					//背景颜色;参数一：透明度（0-1）;参数二：背景颜色（array则为线性渐变，string为单色背景）
					backgroundColor: [1, "#fff"],
					statusBarFontColor: '#1A1A1A',
					backIconColor: "#000",
					onlyMy: true,
				},
				upimgtype: 'other',
				step: 0, //0 显示企业，1显示店铺
				certificateType: null,
				oldpProvinceDataList: [],
				newProvinceDataList: [
					// [],
					// [],
					// []
				],
				multiIndex: [0, 0, 0],
				dataform: {
					company_name: '', //企业名称
					credit_code: '', //统一信用代码
					business_scope: '', //经营范围
					province: '', //企业省市区
					company_address: '', //企业地址
					legal_representative: '', //法人姓名
					id_type: null, //法人代证件类型（0身份证、1护照）
					id_number: '', //法代证件号码
					lr_mobile: '', //法人手机号
					lr_email: '', //法代邮箱
					mobile: "", //手机
					identity_code: "", //身份证号
					shop_name: "", //店铺名
					main_name: '', //主体名称
					loser: '', //运营人姓名
					province_name: "", //省的名称
					province_code: "", //省编号
					city_code: "", //市编号
					city_name: "", //市名称
					area_name: "", //区名称
					area_code: "", //区编号
					address: "", //详细地址
					map_punctuation: '', //店铺地图选址
					business_hours: "", //营业时间
					time_quantum: '', //时间段
					customer_service_phone: '', //客服电话
					remark: "", //店铺介绍
					place_remark: '', //场地说明
					noticeItems: "", //注意事项
					tx_longitude: "", //微信经度
					tx_latitude: "", //微信纬度
					logo: "", //店铺logo
					store_images: "", //门店图片
					business_license_images: "", //商家经营执照
					identty_images: "", //身份证下反面
				},
				showSelected: false,
				checkAggrement: true,
				audit_status: "1", //审核状态（0待审核，1审核通过，2审核不通过）
				checkedArrey: [],
				weeks: ['周一', '周二', '周三', '周四', '周五', '周六', '周日', ],
				beginTime: "",
				endTime: "",
				logo: [], //店铺logo
				store_images: [], //门店图片
				business_license_images: [], //商家经营执照
				identty_images: [], //身份证下反面
				streetList: [],
				communityList: [],
				areaShow: false,
				streetShow: false,
				communityShow: false,
				areaShowType: 1, //弹窗类型  1 企业信息地区   2商家地区
				weekShow: false,
				settleMode: 0, // 入驻方式 0 线上 1 联盟
			}
		},
		//写这监听滑动事件，是为了点击填写店铺信息资料时，回到顶部
		onPageScroll(e) {
			if (e.scrollTop > 300) {
				this.floorstatus = true
			} else {
				this.floorstatus = false
			}
		},
		onLoad(options) {
			if (options.settleMode) {
				this.settleMode = options.settleMode
			}
			let that = this;
			if (options.type) {
				//1 审核不通过
				if (options.type == 1) {
					this.getUserInfo()
				}
			}
			//获取省市区
			this.$http.get('/cnarea/tree-lbs', {}).then(async res => {
				let provincesList = res.tree.children;
				// for (let i = 0; i < provincesList.length; i++) {
				// 	this.newProvinceDataList[0].push(provincesList[i]);
				// 	for (let c = 0; c < provincesList[i].children.length; c++) {
				// 		this.newProvinceDataList[1].push(provincesList[i].children[c]);
				// 		if (provincesList[i].children[c].children) {
				// 			for (let a = 0; a < provincesList[i].children[c].children.length; a++) {
				// 				this.newProvinceDataList[2].push(provincesList[i].children[c].children[a]);
				// 			}
				// 		} else {
				// 			this.newProvinceDataList[2] = [];
				// 		}
				// 	}
				// }
				this.newProvinceDataList = provincesList
				that.oldpProvinceDataList = provincesList;
			})
		},

		methods: {
			// 协议勾选
			aggrementCheck() {
				this.checkAggrement = !this.checkAggrement
			},
			linkAgreement() {
				uni.navigateTo({
					url: '/pages/user/agreement?type=2'
				})
			},
			openAreaSelect(num) {
				this.areaShow = true;
				this.areaShowType = num;
			},
			// 获取地区
			areaConfirm(e) {
				if (e.length > 0) {
					if (this.areaShowType == 1) {
						this.dataform.province = e[0].label + e[1].label + e[2].label
					} else {
						this.dataform.province_name = e[0].label;
						this.dataform.province_code = e[0].value;
						this.dataform.city_name = e[1].label;
						this.dataform.city_code = e[1].value;
						this.dataform.area_name = e[2].label;
						this.dataform.area_code = e[2].value;
						this.getAreaList(this.dataform.area_code, 'street');
						this.dataform.street_name = "";
						this.dataform.street_code = "";
						this.dataform.community_name = "";
						this.dataform.community_code = ""
					}
				}
			},
			// 获取街道列表
			getAreaList(parentCode, type) {
				this.$http.get(`/cnarea/lbs-children/${parentCode}`, {}).then(res => {
					if (res && res.code == 200) {
						if (type == 'street') {
							this.streetList = res.list;
							// this.getAreaList(this.streetList[this.streetListIndex].value,'community');
						} else {
							this.communityList = res.list;
						}
					}
				});
			},
			// 选择街道
			streetConfirm(e) {
				if (e.length > 0) {
					this.dataform.street_name = e[0].label;
					this.dataform.street_code = e[0].value;
					this.getAreaList(this.dataform.street_code, 'community')
				} else {
					this.dataform.street_name = null;
					this.dataform.street_code = null;
					this.communityList = [];
				}
				this.dataform.community_name = "";
				this.dataform.community_code = ""
			},
			// 选择社区
			communityConfirm(e) {
				if (e.length > 0) {
					this.dataform.community_name = e[0].label;
					this.dataform.community_code = e[0].value
				} else {
					this.dataform.community_name = null;
					this.dataform.community_code = null;
				}
			},
			onlyLink(e) {
				if (e == 1) {
					if (this.step == 1) {
						this.step = 0
					} else if (this.step == 0) {
						uni.navigateBack({
							delta: 1
						})
					}
				}
			},
			getUserInfo() {
				//获取店铺信息
				this.$http.get('/yxt/shopapply/shopApplyInfo', {
					union_business: this.settleMode == 0 ? false : true
				}).then(res => {
					if (res && res.code == 200 && res.data) {
						this.dataform = res.data
						//将字符串转成图片数组
						if (res.data.logo) {
							this.logo = res.data.logo.split(',')
						}
						if (res.data.business_license_images) {
							this.business_license_images = res.data.business_license_images.split(',')
						}
						if (res.data.identty_images) {
							this.identty_images = res.data.identty_images.split(',')
						}
						if (res.data.store_images) {
							this.store_images = res.data.store_images.split(',')
						}
						//拆分时间
						if (res.data.time_quantum) {
							this.beginTime = res.data.time_quantum.split('-')[0]
							this.endTime = res.data.time_quantum.split('-')[1]
						}
						if (res.data.tx_longitude) {
							this.showSelected = true
						}
					}
				})
			},
			//上传身份证
			resultUrlone(e) {
				this.identty_images = e
			},
			//上传店铺logo
			resultUrlLogo(e) {
				this.logo = e
			},
			//上传门店
			resultUrltwo(e) {
				this.store_images = e
			},
			//上传营业执照
			resultUrlthree(e) {
				this.business_license_images = e
			},
			//证件类型
			radio(e) {
				this.dataform.id_type = e
			},
			//步骤e
			nextStep(e) {
				let target = e.detail.value;
				if (!target.company_name) {
					this.$mUtil.toast('请输入企业名称')
					return false
				}
				// if (!target.credit_code) {
				//   this.$mUtil.toast('请输入统一信用代码')
				//   return false
				// }
				// if (!target.business_scope) {
				//   this.$mUtil.toast('请输入经营范围')
				//   return false
				// }
				if (!this.dataform.province) {
					this.$mUtil.toast('请选择省市区')
					return false
				}
				// if (!target.company_address) {
				//   this.$mUtil.toast('请输入企业地址')
				//   return false
				// }
				if (!target.legal_representative) {
					this.$mUtil.toast('请输入法人姓名')
					return false
				}
				// if (this.dataform.id_type == null) {
				//   this.$mUtil.toast('请选择法人证件类型')
				//   return false
				// }
				// if (!target.id_number) {
				//   this.$mUtil.toast('请输入法人证件号码')
				//   return false
				// }
				if (!target.lr_mobile) {
					this.$mUtil.toast('请输入法人手机号')
					return false
				}
				if (!(target.lr_mobile.match(this.$mConfig.telRegex))) {
					this.$mUtil.toast('请输入正确手机号')
					return false
				}
				// if (!target.lr_email) {
				//   this.$mUtil.toast('请输入法人邮箱')
				//   return false
				// }
				if (target.lr_email && !target.lr_email.match(this.$mConfig.mailVerify)) {
					this.$mUtil.toast('请输入正确邮箱')
					return false
				}
				// if (this.business_license_images == '') {
				//   this.$mUtil.toast('请上传营业执照')
				//   return false
				// }
				// if (this.identty_images == '') {
				//   this.$mUtil.toast('请上传法人身份证(正反面)')
				//   return false
				// }
				// if (this.identty_images.length < 2) {
				//   this.$mUtil.toast('请上传法人身份证(正反面)')
				//   return false
				// }
				//将图片转换字符串
				this.dataform.company_name = target.company_name
				this.dataform.credit_code = target.credit_code
				this.dataform.business_scope = target.business_scope
				this.dataform.company_address = target.company_address
				this.dataform.legal_representative = target.legal_representative
				this.dataform.id_number = target.id_number
				this.dataform.lr_mobile = target.lr_mobile
				this.dataform.lr_email = target.lr_email
				this.dataform.business_license_images = this.business_license_images.join(',')
				this.dataform.identty_images = this.identty_images.join(',')
				if (uni.pageScrollTo) {
					uni.pageScrollTo({
						scrollTop: 0
					})
				} else {
					uni.showModal({
						title: '提示',
						content: '当前微信版本过低，无法使用该功能，请升级到最新微信版本后重试。'
					})
				}
				this.step = 1
			},
			//跳转到地图
			goMap() {
				uni.chooseLocation({
					success: (res) => {
						if (res.address) {
							this.dataform.map_punctuation = res.address;
							this.dataform.tx_latitude = res.latitude
							this.dataform.tx_longitude = res.longitude
							this.showSelected = true
						} else {
							this.showSelected = false
						}
					},
				})
			},
			//点击选择营业时间
			goWeeks() {
				// this.$refs.weeksOpen.open()
				this.weekShow = true;
			},
			//点击关闭
			gbClose() {
				this.$refs.weeksOpen.close()
				this.dataform.business_hours = this.checkedArrey.join(',')
			},
			appointment(value) {
				if (this.checkedArrey.indexOf(value) != -1) {
					this.checkedArrey.splice(this.checkedArrey.indexOf(value), 1);
				} else {
					this.checkedArrey.push(value);
				}
			},
			beginTimeChange(e) {
				this.beginTime = e.target.value
			},
			endTimeChange(e) {
				this.endTime = e.target.value
			},
			//提交申请
			formSubmit(e) {
				let target = e.detail.value;
				if (!target.shop_name) {
					this.$mUtil.toast('请输入店铺名称')
					return false
				}
				if (!this.dataform.province_name) {
					this.$mUtil.toast('请选择省市区')
					return false
				}
				// if(!this.dataform.street_name){
				// 	this.$mUtil.toast('请选择所属街道')
				// 	return false
				// }
				// if(!this.dataform.community_name){
				// 	this.$mUtil.toast('请选择所属社区')
				// 	return false
				// }
				// if (!target.address) {
				//   this.$mUtil.toast('请输入店铺详细地址')
				//   return false
				// }
				// if(!this.dataform.map_punctuation){
				// 	this.$mUtil.toast('请选择店铺地图选址')
				// 	return false
				// }
				if (!target.customer_service_phone) {
					this.$mUtil.toast('请输入客服电话')
					return false
				}
				// if (!this.dataform.business_hours) {
				//   this.$mUtil.toast('请选择营业时间')
				//   return false
				// }
				// if (this.beginTime == '') {
				//   this.$mUtil.toast('请选择开始时间段')
				//   return false
				// }
				// if (this.endTime == '') {
				//   this.$mUtil.toast('请选择结束时间段')
				//   return false
				// }
				// if (!target.main_name) {
				//   this.$mUtil.toast('请输入商业主体名称')
				//   return false
				// }
				// if (!target.loser) {
				//   this.$mUtil.toast('请输入运营人姓名')
				//   return false
				// }
				// if (!target.mobile) {
				//   this.$mUtil.toast('请输入运营人电话')
				//   return false
				// }
				if (target.reward_ratio) {
					if (this.$u.test.chinese(target.reward_ratio)) {
						return this.$mUtil.toast('请输入数字类型')
					} else if (!this.$u.test.amount(target.reward_ratio)) {
						return this.$mUtil.toast('门店打赏比例最多保留两位小数')
					} else if (!this.$u.test.range(target.reward_ratio, [0,
							100
						])) {
						return this.$mUtil.toast('门店打赏比例请输入0-100的值')
					}
				}
				// if (!(target.mobile.match(this.$mConfig.telRegex))) {
				//   this.$mUtil.toast('运营人手机号格式错误')
				//   return false
				// }
				// if (!target.remark) {
				//   this.$mUtil.toast('请输入店铺介绍')
				//   return false
				// }
				// if (!target.place_remark) {
				//   this.$mUtil.toast('请输入场地说明')
				//   return false
				// }
				if (this.logo == '') {
					this.$mUtil.toast('请上传店铺logo')
					return false
				}
				// if (this.store_images == '') {
				//   this.$mUtil.toast('请上传店铺图片')
				//   return false
				// }
				if (!this.checkAggrement) {
					this.$mUtil.toast('请先同意协议')
					return false
				}
				this.dataform.shop_name = target.shop_name
				this.dataform.address = target.address
				this.dataform.mobile = target.mobile
				this.dataform.main_name = target.main_name
				this.dataform.loser = target.loser
				this.dataform.customer_service_phone = target.customer_service_phone
				this.dataform.place_remark = target.place_remark
				this.dataform.remark = target.remark
				//将图片数组转成字符串
				this.dataform.logo = this.logo.join(',')
				this.dataform.store_images = this.store_images.join(',')
				//拼接时间段
				this.dataform.time_quantum = this.beginTime + '-' + this.endTime
				// 商家入驻类型
				if (this.settleMode == 1) {
					this.dataform.union_business = true
					this.dataform.reward_ratio = target.reward_ratio || 0
					this.dataform.special_offers = target.special_offers
				}
				console.log('this.dataform', this.dataform)
				this.$http.post('/yxt/shopapply/apply', this.dataform).then(async res => {
					if (res && res.code == 200) {
						uni.showToast({
							title: "提交成功",
							icon: "none",
							duration: 3000
						})
						setTimeout(() => {
							// uni.switchTab({
							// 	url:'../../index/personal'
							// })
							// uni.navigateTo({
							// 	url: "../../research/setup/toBusiness"
							// })
							// uni.navigateTo({
							// 	url:"/pages/user/merchant/audit"
							// })
							if (this.settleMode == 0) {
								uni.reLaunch({
									url: '/pages/user/merchant/audit'
								});
							} else {
								uni.reLaunch({
									url: '/pages/workbench/shop/audit'
								});
							}
						}, 1000)
					} else {
						this.$mUtil.toast(res.msg)
					}
				})
			},
			//企业选择————企业省市区确认事件
			// enterprisePickerChange(e) {
			// 	this.multiIndex = e.detail.value;
			// 	if (this.newProvinceDataList[2][this.multiIndex[2]] != undefined) {
			// 		this.dataform.province = this.newProvinceDataList[0][this.multiIndex[0]].label + this
			// 			.newProvinceDataList[1][this.multiIndex[1]].label + this.newProvinceDataList[2][this.multiIndex[2]]
			// 			.label
			// 	} else {
			// 		this.dataform.province = this.newProvinceDataList[0][this.multiIndex[0]].label + this
			// 			.newProvinceDataList[1][this.multiIndex[1]].label
			// 	}
			// },
			enterprisePickerColumnchange(e) {
				// 第几列滑动
				// console.log(e.detail.column);
				// 第几列滑动的下标
				// console.log(e.detail.value)
				// 第一列滑动
				if (e.detail.column === 0) {
					this.multiIndex[0] = e.detail.value
					this.newProvinceDataList[1] = this.oldpProvinceDataList[this.multiIndex[0]].children.map((item,
						index) => {
						return item
					})
					//当三级存在
					if (this.oldpProvinceDataList[this.multiIndex[0]].children[0].children) {
						if (this.oldpProvinceDataList[this.multiIndex[0]].children[this.multiIndex[1]]) {
							this.newProvinceDataList[2] = this.oldpProvinceDataList[this.multiIndex[0]].children[this
									.multiIndex[1]].children
								.map((item, index) => {
									return item
								})
						}
					} else {
						this.newProvinceDataList[2] = []
					}
					// 第一列滑动  第二列 和第三列 都变为第一个
					this.multiIndex.splice(1, 1, 0)
					this.multiIndex.splice(2, 1, 0)
				}
				// 第二列滑动
				if (e.detail.column === 1) {
					this.multiIndex[1] = e.detail.value
					if (this.oldpProvinceDataList[this.multiIndex[0]].children[0].children) {
						this.newProvinceDataList[2] = this.oldpProvinceDataList[this.multiIndex[0]].children[this
								.multiIndex[1]].children
							.map(
								(item, index) => {
									return item
								})
					} else {
						this.newProvinceDataList[2] = []
					}
					// 第二列 滑动 第三列 变成第一个
					this.multiIndex.splice(2, 1, 0)
				}
				// 第三列滑动
				if (e.detail.column === 2) {
					this.multiIndex[2] = e.detail.value
					// console.log('第三列滑动')
					// console.log(this.multiIndex)
				}
			},
			//商家选择————省市区确认事件
			pickerChange(e) {
				this.multiIndex = e.detail.value;
				if (this.newProvinceDataList[2][this.multiIndex[2]] != undefined) {
					this.dataform.province_name = this.newProvinceDataList[0][this.multiIndex[0]].label
					this.dataform.province_code = this.newProvinceDataList[0][this.multiIndex[0]].value
					this.dataform.city_name = this.newProvinceDataList[1][this.multiIndex[1]].label
					this.dataform.city_code = this.newProvinceDataList[1][this.multiIndex[1]].value
					this.dataform.area_name = this.newProvinceDataList[2][this.multiIndex[2]].label
					this.dataform.area_code = this.newProvinceDataList[2][this.multiIndex[2]].value
					// this.dataform.tx_latitude = this.newProvinceDataList[2][this.multiIndex[2]].latitude
					// this.dataform.tx_longitude = this.newProvinceDataList[2][this.multiIndex[2]].longitude
					this.getAreaList(this.dataform.area_code, 'street')
				} else {
					this.dataform.province_name = this.newProvinceDataList[0][this.multiIndex[0]].label
					this.dataform.province_code = this.newProvinceDataList[0][this.multiIndex[0]].value
					this.dataform.city_name = this.newProvinceDataList[1][this.multiIndex[1]].label
					this.dataform.city_code = this.newProvinceDataList[1][this.multiIndex[1]].value
					// this.dataform.tx_latitude = this.newProvinceDataList[1][this.multiIndex[1]].latitude
					// this.dataform.tx_longitude = this.newProvinceDataList[1][this.multiIndex[1]].longitude
					this.streetList = [];
					this.communityList = [];
				}
			},
			streetChange(e) {
				if (this.streetList && this.streetList.length <= 0) {
					uni.showToast({
						icon: "none",
						title: '请选择所属地区',
						duration: 2000
					});
					return
				}
				this.streetShow = true
			},
			communityChange() {
				if (this.communityList && this.communityList.length <= 0) {
					uni.showToast({
						icon: "none",
						title: '请选择所属街道',
						duration: 2000
					});
					return
				}
				this.communityShow = true
			},
			pickerColumnchange(e) {
				// 第几列滑动
				// console.log(e.detail.column);
				// 第几列滑动的下标
				// console.log(e.detail.value)
				// 第一列滑动
				if (e.detail.column === 0) {
					this.multiIndex[0] = e.detail.value
					this.newProvinceDataList[1] = this.oldpProvinceDataList[this.multiIndex[0]].children.map((item,
						index) => {
						return item
					})
					//当三级存在
					if (this.oldpProvinceDataList[this.multiIndex[0]].children[0].children) {
						if (this.oldpProvinceDataList[this.multiIndex[0]].children[this.multiIndex[1]]) {
							this.newProvinceDataList[2] = this.oldpProvinceDataList[this.multiIndex[0]].children[this
									.multiIndex[1]].children
								.map((item, index) => {
									return item
								})
						}
					} else {
						this.newProvinceDataList[2] = []
					}
					// 第一列滑动  第二列 和第三列 都变为第一个
					this.multiIndex.splice(1, 1, 0)
					this.multiIndex.splice(2, 1, 0)
				}
				// 第二列滑动
				if (e.detail.column === 1) {
					this.multiIndex[1] = e.detail.value
					if (this.oldpProvinceDataList[this.multiIndex[0]].children[0].children) {
						this.newProvinceDataList[2] = this.oldpProvinceDataList[this.multiIndex[0]].children[this
								.multiIndex[1]].children
							.map(
								(item, index) => {
									return item
								})
					} else {
						this.newProvinceDataList[2] = []
					}
					// 第二列 滑动 第三列 变成第一个
					this.multiIndex.splice(2, 1, 0)
				}
				// 第三列滑动
				if (e.detail.column === 2) {
					this.multiIndex[2] = e.detail.value
					// console.log('第三列滑动')
					// console.log(this.multiIndex)
				}
			}
		}
	}
</script>

<style lang="scss">
	page {
		background: #F9F9F9;
	}

	.step-pd {
		padding: 40rpx 30rpx;
	}

	.font68 {
		color: #FFFFFF;
		font-size: 68rpx;
	}

	.u-6087F2 {
		color: #6087F2;
	}

	.vertical-bar {
		width: 4rpx;
		height: 27rpx;
		background: #FF211F;
		border-radius: 10rpx;
		color: #FF211F;
		margin-right: 19rpx;
		font-size: 20rpx;
	}

	.pt14 {
		padding-top: 50rpx;
	}

	.pt30 {
		padding-top: 30rpx;
	}

	.audit {
		width: 100%;
		padding: 42rpx 0rpx;
		margin-bottom: 30rpx;
	}

	.radio,
	.radioView {
		display: flex;
		flex-direction: row;
		justify-content: flex-start;
		align-items: center;
	}

	.auditImg {
		width: 214rpx;
		height: 160rpx;
	}

	.bg-F5FFF9 {
		background-color: #F5FFF9;
	}

	.bg-fff {
		background-color: #FFFFFF;
		padding-bottom: 40rpx;
	}

	.uni-form-item {
		width: 673rpx;
		height: 88rpx;
		background: #F9F9F9;
		border-radius: 15rpx 15rpx 15rpx 15rpx;
		margin-bottom: 19rpx;
		display: flex;
		flex-direction: row;
		justify-content: flex-start;
		align-items: center;
		padding-left: 6rpx;


	}

	.uni-form-item-left {
		display: flex;
		flex-direction: row;
		justify-content: flex-start;
		align-items: center;
	}


	.title {
		width: 250rpx;
	}

	.uni-input {
		width: 100%;
		// height: 70rpx;
		height: auto;
		font-size: 24rpx;
		// padding-left: 20rpx;
		text-align: right;
		// border: 1rpx solid #d9d9d9;
		// border-radius: 8rpx;
		// padding-left: 20rpx;
	}

	.u-position-re {
		position: relative;

		.iconfont {
			position: absolute;
			top: 0rpx;
			left: 20rpx;
		}

		.uni-input {
			width: 366rpx;
			// padding-left: 60rpx;
		}
	}

	.uni-form-textarea {
		margin-top: 19rpx;

		.textarea {
			width: 673rpx;
			height: 192rpx;
			background: #F9F9F9;
			border-radius: 15rpx 15rpx 15rpx 15rpx;
			padding-top: 31rpx;
			padding-left: 19rpx;
			box-sizing: border-box;
			font-weight: 400;
			font-size: 27rpx;
			line-height: 27rpx;
		}
	}

	.btn {
		width: 100%;
		// margin-top: 100rpx;
		// margin-bottom: 40rpx;
		display: flex;
		justify-content: center;
		position: fixed;
		bottom: 23rpx;

		.u-btnAudit {
			width: 673rpx;
			height: 96rpx;
			background: #FF211F;
			border-radius: 19rpx 19rpx 19rpx 19rpx;
			font-weight: 400;
			font-size: 29rpx;
			color: #FFFFFF;
			line-height: 40rpx;
			display: flex;
			flex-direction: row;
			justify-content: center;
			align-items: center;
		}
	}

	.week {
		text-align: center;
		padding-bottom: 20rpx;
	}

	.checkedYes {
		color: #FF211F;
	}

	.weeks-btn {
		background: #FF211F;
		color: #FFFFFF;
	}

	.check {
		position: relative;
		width: 32rpx;
		height: 32rpx;

		.radios {
			width: 30rpx;
			height: 30rpx;
			display: block;
			border: 1px solid #ccc;
			border-radius: 50%;
			position: absolute;
			left: 0;
			top: 0;
			z-index: 1;
		}

		.iconbox {
			position: relative;
			z-index: 2;
		}

	}

	.u-bg-abc5b5 {
		// background-color: rgba(55, 117, 246, 0.5);
		background: linear-gradient(to right, #FFFFFF, #FF721B 50%, #FFFFFF);
		display: flex;
		align-items: center;
		justify-content: center;
	}

	/deep/.uni-input-placeholder {
		color: #AAAAAA !important;
	}

	/deep/ .uni-actionsheet_toggle {
		position: fixed;
		left: 0 !important;
		right: 0 !important;
		bottom: 0 !important;
		background-color: #ffffff !important;
	}

	.stepOne {
		width: 750rpx;
		height: auto;
		background: #FFFFFF;
		border-radius: 0rpx 0rpx 0rpx 0rpx;
		padding-bottom: 19rpx;
		padding-top: 19rpx;
	}

	.stepOneTitle {
		display: flex;
		flex-direction: row;
		justify-content: space-between;
		align-items: flex-start;
		position: relative;

		.stepOneTitleLeft {
			width: 375rpx;
			height: auto;
			display: flex;
			flex-direction: column;
			justify-content: center;
			align-items: center;

			image {
				width: 40rpx;
				height: 40rpx;
				margin-bottom: 15rpx;
			}
		}

		.stepOneTitleLine {
			width: 304rpx;
			height: 2rpx;
			background-color: red;
			position: absolute;
			top: 19rpx;
			left: 223rpx;
		}

		.stepOneTitleRight {
			width: 375rpx;
			height: auto;
			display: flex;
			flex-direction: column;
			justify-content: center;
			align-items: center;

			image {
				width: 40rpx;
				height: 40rpx;
				margin-bottom: 15rpx;
			}
		}
	}

	.longView {
		margin-top: 19rpx;
		width: 100%;
		height: auto;
		background-color: #fff;
		padding: 19rpx 38rpx;
		box-sizing: border-box;
	}

	.titleView {
		font-weight: 600;
		font-size: 27rpx;
		color: #333333;
		line-height: 32rpx;
	}

	.titleViewText {
		font-weight: 400;
		font-size: 27rpx;
		color: #999999;
		line-height: 32rpx;
	}

	.barView {
		margin-bottom: 19rpx;
	}

	.pleaseCity {
		font-weight: 400;
		font-size: 24rpx;
		color: #333333;
		line-height: 24rpx;
		text-align: left;
	}

	.labelView {
		font-weight: 400;
		font-size: 24rpx;
		color: #999999;
		line-height: 24rpx;
	}

	.container {
		height: auto;
		padding-bottom: 23rpx;
		background-color: #fff;
	}
	.stepBottom{
		padding-bottom: 110rpx;
	}

	.huiView {
		width: 100%;
		height: 19rpx;
		background: #F9F9F9;
	}

	.marginLeft33 {
		padding-left: 19rpx;
	}

	.flex-spaceBetween {
		display: flex;
		flex-direction: row;
		justify-content: space-between;
		align-items: center;
		padding-right: 19rpx;
	}

	.dataformView {
		font-weight: 400 !important;
		font-size: 27rpx !important;
		color: #333333 !important;
		line-height: 27rpx !important;
	}

	.radioLabel {
		font-weight: 400;
		font-size: 27rpx;
		color: #999999;
		line-height: 27rpx;
	}

	.uni-radio-wrapper {
		background-color: #FF211F;
	}

	// /deep/.uni-form-item /deep/.uni-radio-input:hover {
	//     border-color: #FF211F !important;
	//     background: #FF211F !important;
	// }
	/deep/ .uni-radio-input:hover {
		border-color: #FF211F !important;
		background: #FF211F !important;
	}

	.huiRight {
		height: 24rpx;
		width: 12rpx;
		position: absolute;
		right: 19rpx;
	}

	.yingyeTime {
		display: flex;
		flex-direction: row;
		justify-content: space-between;
		align-items: center;
		padding-right: 19rpx;
	}

	.timeView {
		display: flex;
		flex-direction: row;
		justify-content: flex-start;
		align-items: center;

	}

	.textareaPlace {
		font-weight: 400;
		font-size: 27rpx;
		color: #999999;
		line-height: 27rpx;
	}

	.gouxuan {
		margin-left: 8rpx;
		font-weight: 500;
		font-size: 27rpx;
		color: #FF211F;
		line-height: 27rpx;
	}

	.gouxuanView {
		margin-top: 38rpx;
	}

</style>